#!/usr/bin/python
# -*- coding: UTF-8 -*-
#Boa:Frame:Frame1
#-----------------------------------------------------------------------------
# Name:         Class_Serv_IHM
# Purpose:      Creation d'un socket a chaque lancement de ABC IHM
#               Permet de controler le nombre de programme lancer a 1
#               
#               
#
# Author:      ABCPro
#
# Created:     2007/05/18
# Copyright:   (c) 2007
# Licence:     <your licence>
#-----------------------------------------------------------------------------


 
from asyncore import dispatcher
import sys, time, socket, wx
 
class Server( dispatcher ):
  def __init__(self):
    '''On crée un socket sur le port 50001
       si on tente de lancer une autre instance de l'ihm
       le socket empecheras la relance
    '''  
    dispatcher.__init__(self)
    self.create_socket( socket.AF_INET, socket.SOCK_STREAM )
    self.bind( ( '', 50001 ) )
    self.listen(1)
 
try:
  Server()
except:
  sys.exit()
 
